name in Global := "id-mapping"
organization in Global := "com.zz"
scalaVersion in Global := "2.13.1"

version := "0.1"

autoCompilerPlugins in Global := true

lazy val root = project.in(file("."))
  .settings(name := (name in Global).value)
  .settings(coverageSettings)
  .aggregate(core)

lazy val core = project.in(file("core"))
  .settings(scalacOptions ++= commonScalacOptions)

lazy val wartRemoverSettings = Seq(
  wartremoverWarnings ++= Warts.allBut(Wart.Equals)
)

lazy val commonScalacOptions = Seq(
  "-deprecation"
  , "-encoding", "UTF-8"
  , "-language:postfixOps"
  , "-language:higherKinds"
)

lazy val coverageSettings = Seq(
  coverageEnabled := false,
  coverageFailOnMinimum := true,
  coverageMinimum := 80,
  coverageOutputCobertura := false,
  coverageOutputXML := false
)

addCommandAlias("validate", ";clean;protobuf:protobufGenerate;coverage;test;coverageReport")
// addCommandAlias("benchmark", ";clean;bench/jmh:compile;bench/jmh:run")
addCommandAlias("package", ";core/universal:packageZipTarball")
addCommandAlias("stage", ";core/stage")
addCommandAlias("build", ";validate;coverageOff;package")
addCommandAlias("run", ";core/run")
addCommandAlias("pkg", ";core/universal:packageZipTarball")
